import QtQuick 2.0
import Sailfish.Silica 1.0
import "../component"
import "../config"

Page {
    id: splashPage

    // 页面加载时立即启动定时器
    Component.onCompleted: {
        timer.start();
    }

    Timer {
        id: timer
        interval: 2000 // 2秒
        onTriggered: {
            // 跳转到目标页面，并从堆栈中移除当前页面
            pageStack.animatorPush(Qt.resolvedUrl("MainPage.qml"),{},PageStackAction.Immediate)
        }
    }

    // 设置屏幕方向
    allowedOrientations: Orientation.All

    //#0D8170
    Rectangle{
        width: parent.width
        height: parent.height
        color: "transparent"


        //欢迎页图片
        Column{
            width: parent.width*0.8
            anchors.centerIn: parent
            Icon {
                id: splashImg
                source: "../img/img_splash_text.svg"
                width: parent.width
                color: AppColor.themeMode.thirdColor
                fillMode: Image.PreserveAspectFit
            }
        }


        //软件logo
        Row{
            height: 180
            anchors.horizontalCenter: parent.horizontalCenter
            anchors.bottom: parent.bottom
            anchors.bottomMargin: 24
            UIRadiusImage{
                source: "../img/icon_logo.png"
                width: 160
                height: 160
                radius: width*0.1
            }

            Item {
                width: 20
                height: 1
            }

            Text {
                id:appName
                text: qsTr("SailBook ")
                font.pixelSize: Theme.fontSizeLarge
                anchors.verticalCenter: parent.verticalCenter
                color: AppColor.themeMode.primaryColor
            }
            Text {
                text: qsTr("for Sailfish OS")
                font.pixelSize: Theme.fontSizeTiny
                color: AppColor.themeMode.thirdColor
                anchors.baseline: appName.baseline
            }
        }



    }
}
